class xG_PlayerController extends x_PlayerController;

//=============================================================================
// Variables: General
//=============================================================================


//=============================================================================
// Functions: General
//=============================================================================
simulated function PostBeginPlay()
{
	super.PostBeginPlay();
}

function PlayMusic()
{
	MusicManager.ChangeTrack(EMST_music_Geo_MainTheme);
}


//exec function ShowMainMenu()
//{   
//	if (MainMenuMovie == none)
//	{
//		MainMenuMovie = new class'xG_GFx_MainMenu';
//		MainMenuMovie.InitUI(x_GameInfo(Worldinfo.game), LocalPlayer(self.Player));
//		MainMenuMovie.SetViewScaleMode( SM_ExactFit );
//		MainMenuMovie.SetAlignment( Align_Center );
//		WorldInfo.Game.SetPause(self);
//	} 
//	else 
//	{
//		MainMenuMovie.Close();
//		MainMenuMovie = none;
//		WorldInfo.Game.ClearPause();
//	}
//}

//=============================================================================
// Functions: States
//=============================================================================
/** Empty sate**/
AUTO STATE GeoGameControllerState
{

	function UpdateEarthView(Rotator aNewRoation)
	{
		local vector lViewDirection,lCenterOfRotation,lNewLocation;

		lCenterOfRotation = class'x_Settings'.default.GEO_WorldCenter; // roation around center of world, maybe you can use center of your world staticmesh	
		SetRotation(aNewRoation);
		lViewDirection = Normal(vector(Rotation)); // no create a vector from your rotation, its your View Direction...normalize it
		lNewLocation = lCenterOfRotation - (lViewDirection * class'x_Settings'.default.GEO_DistanceFromPlanet); // multiply with a distance factor, use negative viewdir (so we will look at our center point)	
		SetLocation(lNewLocation);		
	}
	
}

function UpdateEarthView(Rotator aNewRoation); // overriden in states

//=============================================================================
// Default Properties
//=============================================================================
defaultproperties
{
	InputClass=class'xLED_GEO.xG_PlayerInput'
}
